//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.itheima.pinda.authority.entity.auth;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.itheima.pinda.authority.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDateTime;
import javax.validation.constraints.NotEmpty;
import org.hibernate.validator.constraints.Length;

@TableName("pd_auth_resource")
@ApiModel(
        value = "Resource",
        description = "资源"
)
public class Resource extends Entity<Long> {
    private static final long serialVersionUID = 1L;
    @ApiModelProperty("资源编码")
    @Length(
            max = 255,
            message = "资源编码长度不能超过255"
    )
    @TableField(
            value = "code",
            condition = "%s LIKE CONCAT('%%',#{%s},'%%')"
    )
    private String code;
    @ApiModelProperty("接口名称")
    @NotEmpty(
            message = "接口名称不能为空"
    )
    @Length(
            max = 255,
            message = "接口名称长度不能超过255"
    )
    @TableField(
            value = "name",
            condition = "%s LIKE CONCAT('%%',#{%s},'%%')"
    )
    private String name;
    @ApiModelProperty("菜单ID")
    @TableField("menu_id")
    private Long menuId;
    @ApiModelProperty("接口描述")
    @Length(
            max = 255,
            message = "接口描述长度不能超过255"
    )
    @TableField(
            value = "describe_",
            condition = "%s LIKE CONCAT('%%',#{%s},'%%')"
    )
    private String describe;
    @ApiModelProperty("请求方式")
    @TableField("method")
    private String method;
    @ApiModelProperty("请求url地址")
    @TableField("url")
    private String url;

    public Resource(Long id, Long createUser, LocalDateTime createTime, Long updateUser, LocalDateTime updateTime, String code, String name, Long menuId, String describe, String method, String url) {
        this.id = id;
        this.createUser = createUser;
        this.createTime = createTime;
        this.updateUser = updateUser;
        this.updateTime = updateTime;
        this.code = code;
        this.name = name;
        this.menuId = menuId;
        this.describe = describe;
        this.method = method;
        this.url = url;
    }

    public static Resource.ResourceBuilder builder() {
        return new Resource.ResourceBuilder();
    }

    public String getCode() {
        return this.code;
    }

    public String getName() {
        return this.name;
    }

    public Long getMenuId() {
        return this.menuId;
    }

    public String getDescribe() {
        return this.describe;
    }

    public String getMethod() {
        return this.method;
    }

    public String getUrl() {
        return this.url;
    }

    public Resource setCode(final String code) {
        this.code = code;
        return this;
    }

    public Resource setName(final String name) {
        this.name = name;
        return this;
    }

    public Resource setMenuId(final Long menuId) {
        this.menuId = menuId;
        return this;
    }

    public Resource setDescribe(final String describe) {
        this.describe = describe;
        return this;
    }

    public Resource setMethod(final String method) {
        this.method = method;
        return this;
    }

    public Resource setUrl(final String url) {
        this.url = url;
        return this;
    }

    public Resource() {
    }

    public Resource(final String code, final String name, final Long menuId, final String describe, final String method, final String url) {
        this.code = code;
        this.name = name;
        this.menuId = menuId;
        this.describe = describe;
        this.method = method;
        this.url = url;
    }

    public String toString() {
        return "Resource(super=" + super.toString() + ", code=" + this.getCode() + ", name=" + this.getName() + ", menuId=" + this.getMenuId() + ", describe=" + this.getDescribe() + ", method=" + this.getMethod() + ", url=" + this.getUrl() + ")";
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof Resource)) {
            return false;
        } else {
            Resource other = (Resource)o;
            if (!other.canEqual(this)) {
                return false;
            } else if (!super.equals(o)) {
                return false;
            } else {
                Object this$code = this.getCode();
                Object other$code = other.getCode();
                if (this$code == null) {
                    if (other$code != null) {
                        return false;
                    }
                } else if (!this$code.equals(other$code)) {
                    return false;
                }

                Object this$name = this.getName();
                Object other$name = other.getName();
                if (this$name == null) {
                    if (other$name != null) {
                        return false;
                    }
                } else if (!this$name.equals(other$name)) {
                    return false;
                }

                label71: {
                    Object this$menuId = this.getMenuId();
                    Object other$menuId = other.getMenuId();
                    if (this$menuId == null) {
                        if (other$menuId == null) {
                            break label71;
                        }
                    } else if (this$menuId.equals(other$menuId)) {
                        break label71;
                    }

                    return false;
                }

                label64: {
                    Object this$describe = this.getDescribe();
                    Object other$describe = other.getDescribe();
                    if (this$describe == null) {
                        if (other$describe == null) {
                            break label64;
                        }
                    } else if (this$describe.equals(other$describe)) {
                        break label64;
                    }

                    return false;
                }

                Object this$method = this.getMethod();
                Object other$method = other.getMethod();
                if (this$method == null) {
                    if (other$method != null) {
                        return false;
                    }
                } else if (!this$method.equals(other$method)) {
                    return false;
                }

                Object this$url = this.getUrl();
                Object other$url = other.getUrl();
                if (this$url == null) {
                    if (other$url != null) {
                        return false;
                    }
                } else if (!this$url.equals(other$url)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof Resource;
    }

    public int hashCode() {
        boolean PRIME = true;
        int result = super.hashCode();
        Object $code = this.getCode();
        result = result * 59 + ($code == null ? 43 : $code.hashCode());
        Object $name = this.getName();
        result = result * 59 + ($name == null ? 43 : $name.hashCode());
        Object $menuId = this.getMenuId();
        result = result * 59 + ($menuId == null ? 43 : $menuId.hashCode());
        Object $describe = this.getDescribe();
        result = result * 59 + ($describe == null ? 43 : $describe.hashCode());
        Object $method = this.getMethod();
        result = result * 59 + ($method == null ? 43 : $method.hashCode());
        Object $url = this.getUrl();
        result = result * 59 + ($url == null ? 43 : $url.hashCode());
        return result;
    }

    public static class ResourceBuilder {
        private Long id;
        private Long createUser;
        private LocalDateTime createTime;
        private Long updateUser;
        private LocalDateTime updateTime;
        private String code;
        private String name;
        private Long menuId;
        private String describe;
        private String method;
        private String url;

        ResourceBuilder() {
        }

        public Resource.ResourceBuilder id(final Long id) {
            this.id = id;
            return this;
        }

        public Resource.ResourceBuilder createUser(final Long createUser) {
            this.createUser = createUser;
            return this;
        }

        public Resource.ResourceBuilder createTime(final LocalDateTime createTime) {
            this.createTime = createTime;
            return this;
        }

        public Resource.ResourceBuilder updateUser(final Long updateUser) {
            this.updateUser = updateUser;
            return this;
        }

        public Resource.ResourceBuilder updateTime(final LocalDateTime updateTime) {
            this.updateTime = updateTime;
            return this;
        }

        public Resource.ResourceBuilder code(final String code) {
            this.code = code;
            return this;
        }

        public Resource.ResourceBuilder name(final String name) {
            this.name = name;
            return this;
        }

        public Resource.ResourceBuilder menuId(final Long menuId) {
            this.menuId = menuId;
            return this;
        }

        public Resource.ResourceBuilder describe(final String describe) {
            this.describe = describe;
            return this;
        }

        public Resource.ResourceBuilder method(final String method) {
            this.method = method;
            return this;
        }

        public Resource.ResourceBuilder url(final String url) {
            this.url = url;
            return this;
        }

        public Resource build() {
            return new Resource(this.id, this.createUser, this.createTime, this.updateUser, this.updateTime, this.code, this.name, this.menuId, this.describe, this.method, this.url);
        }

        public String toString() {
            return "Resource.ResourceBuilder(id=" + this.id + ", createUser=" + this.createUser + ", createTime=" + this.createTime + ", updateUser=" + this.updateUser + ", updateTime=" + this.updateTime + ", code=" + this.code + ", name=" + this.name + ", menuId=" + this.menuId + ", describe=" + this.describe + ", method=" + this.method + ", url=" + this.url + ")";
        }
    }
}
